package com.lock.chess.config;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;

import java.util.Random;

public class CustomIdGenerator implements IdentifierGenerator {

    @Override
    public Number nextId(Object entity) {
        Random random = new Random();
        // 生成一个6位长度的随机数
        int id = 100000 + random.nextInt(900000);
        return id;
    }
}